#!/usr/bin/ruby

require "erb"

class LogWriter
def get_log_file_content(
	step=15 ,
	tt_scale = "0.05",
	www = "http://www.bademjoon.com",
	outputFile = "log.txt",
	context="/tpcw",
	workloadFraction = "1",
	ifGetImage="false",
	debug="1",
	workload="  1 107 214 32")
  # Create template.
  template = %q{
	step=<%=step%>
	tt_scale=<%=tt_scale%>
	www=<%=www%>
	outputFile=<%=outputFile%>
	context=<%=context%>
	workloadFraction=<%=workloadFraction%>
	ifGetImage=<%=ifGetImage%>
	debug=<%=debug%>
	workload=<%=workload%>
  }.gsub(/^  /, '')

  return ERB.new(template).result(binding)
end

 
end #class

if ARGV.size!=1 then puts "supply output file"
else 
text=  LogWriter.new.get_log_file_content("15" , "0.05", "http://www.bademjoon.com","log.txt","/tpcw", "1","false","1", " 1 107 214 32")
File.open(ARGV[0], 'w') {|f| f.write(text)}
end
